package org.jsoncrypto;

import java.security.PrivateKey;
import java.security.PublicKey;

import javax.crypto.SecretKey;

public abstract class JcLibJwe_PK<TPublicKey extends PublicKey, TPrivateKey extends PrivateKey> extends JcLibJwe {

	public JcLibJwe_PK(JcLibEnc enc, String algStr) throws JcBaseException {
		super(enc, algStr);
	}

	public JcLibJwe_PK(String encrypted) throws JcBaseException {
		super(encrypted);
	}
	
	abstract public String encrypt(byte[] contentBytes, TPublicKey aKey, String encodedJweIvSegment) throws JcBaseException;
	abstract public byte[] decrypt(TPrivateKey aKey) throws JcBaseException;

  abstract SecretKey generateContentEncryptionKey(TPublicKey pubkey) throws JcBaseException;
  
  abstract String generateEncodedEncryptedKey(TPublicKey pubkey, SecretKey contentEncryptionKey) throws JcBaseException;

}
